xen/arm: Introduce xen, passthrough property
authorJulien Grall <julien.grall@linaro.org>
Wed, 1 Apr 2015 16:21:39 +0000 (17:21 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 2 Apr 2015 09:42:34 +0000 (10:42 +0100)
commitcb818a58f6f785bb41a35bc1d1e52c66ffbe1e8b
treeeeea0e321b4672e3356a8ab627287ada6abe0397
parent3d1fab806c165096b3fedc78ecb5650b945e21a6
xen/arm: Introduce xen, passthrough property

When a device is marked for passthrough (via the new property
"xen,passthrough"), dom0 must not access to the device (i.e not
loading a driver), but should be able to manage the MMIO/interrupt
of the passthrough device.

The latter part will allow the toolstack to map MMIO/IRQ when a device
is pass through to a guest.

The property "xen,passthrough" will be translated as 'status="disabled"'
in the device tree to avoid DOM0 using the device. We assume that DOM0 is
able to cope with this property (already the case for Linux, and
required by ePAPR).

Rework the function map_device (renamed into handle_device) to:

* For a given device node:
    - Give permission to manage IRQ/MMIO for this device
    - Retrieve the IRQ configuration (i.e edge/level) from the device
    tree
* When the device is not marked for guest passthrough:
    - Assign the device to the guest if it's protected by an IOMMU
    - Map the IRQs and MMIOs regions to the guest

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
docs/misc/arm/device-tree/passthrough.txt [new file with mode: 0644]
xen/arch/arm/device.c
xen/arch/arm/domain_build.c
xen/common/device_tree.c
xen/include/xen/device_tree.h